<div class="cart">
	<form action="" method="post">

		<?php if(!empty($this->row['id'])): ?>
		<input type="hidden" name="id" value="<?php echo $this->row['id']; ?>" />
		<?php endif; ?>
		
		<label for="vocab"><?php echo _('Название карточки'); ?></label>
		<input id="vocab" type="text" class="i-text" name="vocabulary[title]" value="<?php if(!empty($this->row['title'])) echo $this->row['title']; ?>" />

		<div class="words">
			<label><?php echo _('Слова'); ?></label>
			
			<?php if(!empty($this->row['words'])): ?>
			<?php foreach($this->row['words'] as $word): ?>
			<div class="item">
				<input type="text" class="i-text word" name="words[word][]" value="<?php if(!empty($word['word'])) echo $word['word']; ?>" /> - <input type="text" class="i-text translate" name="words[translate][]" value="<?php if(!empty($word['translate'])) echo $word['translate']; ?>" />
				<a class="del-word" href="#delete"></a>
			</div>
			<?php endforeach; ?>
			
			<div class="item">
				<input type="text" class="i-text word" name="words[word][]" value="" /> - <input type="text" class="i-text translate" name="words[translate][]" value="" />
				<a class="del-word" href="#delete"></a>
			</div>
			
			<?php else: ?>
			
			<div class="item">
				<input type="text" class="i-text word" name="words[word][]" value="" /> - <input type="text" class="i-text translate" name="words[translate][]" value="" />
			</div>
			
			<?php endif; ?>
		</div>

		<button type="submit" class="button"><?php echo _('Сохранить'); ?></button>

	</form>
</div>